//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __I2S_H__
#define __I2S_H__

#ifdef  __cplusplus
extern "C" {
#endif

void I2C_Initial(void);
void I2C_Read(unsigned char * pData, unsigned long dwLen);
//void I2C_RW(unsigned char addr, unsigned char * pData, unsigned long dwLen);
void I2C_RW(unsigned char addr1, unsigned char addr2, unsigned char * pData, unsigned long dwLen);
int i2c_byte_read(unsigned char ucAddr,unsigned char *rtnData);
int i2c_byte_write(unsigned char ucAddr, unsigned char ucData);
int i2c_buffer_write(unsigned char ucAddr, unsigned char *ucData,short count);
int i2c_write_core(unsigned char ucData);

int  I2C_write_byte(char regaddr,char val);
int  I2C_read_byte(char regaddr,char *buf);
EXTERN_C int I2C_write_buffer(BYTE *buf, int cnt);
EXTERN_C int I2C_read_buffer(BYTE *buf, int cnt);

#ifdef  __cplusplus
}
#endif

#endif   //__I2S_H__
